package org.example.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.Data;

@Data
public class Category {
  @NotNull(groups = Update.class)
  private long id;
  //主键ID
  @NotEmpty
//          (groups = {Add.class,Update.class})
  private String categoryName;
  //分类名称
  @NotEmpty
//          (groups = {Add.class,Update.class})
  private String categoryAlias;
  //分类别名
  private long createUser;
  //创建人ID
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private java.sql.Timestamp createTime;
  //创建时间
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private java.sql.Timestamp updateTime;
  //更新时间

  //如果说某个校验项没有指定分组，默认属于Default分组
  //分组之间可以继承，A extends B 那么A中拥有B中所有校验项

  public interface  Add extends Default {

  }
  public interface  Update extends  Default{

  }


  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }


  public String getCategoryName() {
    return categoryName;
  }

  public void setCategoryName(String categoryName) {
    this.categoryName = categoryName;
  }


  public String getCategoryAlias() {
    return categoryAlias;
  }

  public void setCategoryAlias(String categoryAlias) {
    this.categoryAlias = categoryAlias;
  }


  public long getCreateUser() {
    return createUser;
  }

  public void setCreateUser(long createUser) {
    this.createUser = createUser;
  }


  public java.sql.Timestamp getCreateTime() {
    return createTime;
  }

  public void setCreateTime(java.sql.Timestamp createTime) {
    this.createTime = createTime;
  }


  public java.sql.Timestamp getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(java.sql.Timestamp updateTime) {
    this.updateTime = updateTime;
  }

}
